<?php
class Gallery extends Controller
{
	function Gallery()
	{
		parent::Controller();
		$this->load->library('phpflickr');
		$this->load->helper('html');
		$this->load->helper('url');
		$this->load->helper('mypage'); //zeratool helper.
		$this->load->helper('request');
	}
	
	function index()
	{
		$data['title'] = "Gallery";
		$data['flickruserid'] = '22525955@N05';
		$username = 'badjuuuu';
		$key = '5cd42ae94dbbb3726768cca814080edf';		
		
		
		
		$request = getRequests();
		$data['page'] = isset($request['page']) ? $request['page'] : 1;
		
		$this->phpflickr->enableCache("fs", APPPATH . "cache");
		
		$result = $this->phpflickr->people_findByUsername($username);	
		$nsid = $result["id"];
		$photos = $this->phpflickr->people_getPublicPhotos($nsid, NULL, NULL, 25, $data['page']);	
		
		$data['pages'] = $photos['photos']['pages'];
		$data['total'] = $photos['photos']['total'];
		$data['photos'] = $photos['photos']['photo'];	
		
		$this->load->view('gallery', $data);
	}
}

/* End of file gallery.php */
/* Location: ./system/application/badjography/controllers/gallery.php */
